package hihocode;

import java.util.Scanner;

//哥德巴赫猜想
public class GoldbachConjecture {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int num;
		while(scanner.hasNext()){
			num = scanner.nextInt();
			int middle = num / 2;
			for(int i = 3; i < middle; ){
				int b = num - i;
				if(isPrime(b)){
					System.out.println(i + " " + b);
					break;
				}
				i = getNextPrime(i);
			}
		}
		scanner.close();
	}
	
	public static int getNextPrime(int x) {
		for (int i = x + 2;; i += 2) {
			if (isPrime(i)) {
				return i;
			}
		}
	}
	
	public static boolean isPrime(int x) {
		if (x <= 0) {
			System.err.println("您输入的数据有误");
			return false;
		}
		// 1不是素数
		if (x == 1) {
			return false;
		}
		// 这个对于2以上的才有效
		int sqrtOfX = (int) Math.floor(Math.sqrt(x));
		for (int i = 3; i <= sqrtOfX; i += 2) {
			// 一旦有除尽的，就返回假
			if (x % i == 0) {
				return false;
			}
		}
		return true;
	}
}
